\(\int (b \sec (c+d x))^{5/2} (A+B \sec (c+d x)) \, dx\) [1]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 23, antiderivative size = 171 \[ \int (b \sec (c+d x))^{5/2} (A+B \sec (c+d x)) \, dx=-\frac {6 b^3 B E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d \sqrt {\cos (c+d x)} \sqrt {b \sec (c+d x)}}+\frac {2 A b^2 \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {b \sec (c+d x)}}{3 d}+\frac {6 b^2 B \sqrt {b \sec (c+d x)} \sin (c+d x)}{5 d}+\frac {2 A b (b \sec (c+d x))^{3/2} \sin (c+d x)}{3 d}+\frac {2 B (b \sec (c+d x))^{5/2} \sin (c+d x)}{5 d} \]

[Out]

2/3*A*b*(b*sec(d*x+c))^(3/2)*sin(d*x+c)/d+2/5*B*(b*sec(d*x+c))^(5/2)*sin(d*x+c)/d-6/5*b^3*B*(cos(1/2*d*x+1/2*c
)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticE(sin(1/2*d*x+1/2*c),2^(1/2))/d/cos(d*x+c)^(1/2)/(b*sec(d*x+c))^(1/2)+6/
5*b^2*B*sin(d*x+c)*(b*sec(d*x+c))^(1/2)/d+2/3*A*b^2*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticF(
sin(1/2*d*x+1/2*c),2^(1/2))*cos(d*x+c)^(1/2)*(b*sec(d*x+c))^(1/2)/d

Rubi [A] (verified)

Time = 0.14 (sec) , antiderivative size = 171, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3872, 3853, 3856, 2720, 2719} \[ \int (b \sec (c+d x))^{5/2} (A+B \sec (c+d x)) \, dx=\frac {2 A b^2 \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {b \sec (c+d x)}}{3 d}+\frac {2 A b \sin (c+d x) (b \sec (c+d x))^{3/2}}{3 d}-\frac {6 b^3 B E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d \sqrt {\cos (c+d x)} \sqrt {b \sec (c+d x)}}+\frac {6 b^2 B \sin (c+d x) \sqrt {b \sec (c+d x)}}{5 d}+\frac {2 B \sin (c+d x) (b \sec (c+d x))^{5/2}}{5 d} \]

[In]

Int[(b*Sec[c + d*x])^(5/2)*(A + B*Sec[c + d*x]),x]

[Out]

(-6*b^3*B*EllipticE[(c + d*x)/2, 2])/(5*d*Sqrt[Cos[c + d*x]]*Sqrt[b*Sec[c + d*x]]) + (2*A*b^2*Sqrt[Cos[c + d*x
]]*EllipticF[(c + d*x)/2, 2]*Sqrt[b*Sec[c + d*x]])/(3*d) + (6*b^2*B*Sqrt[b*Sec[c + d*x]]*Sin[c + d*x])/(5*d) +
 (2*A*b*(b*Sec[c + d*x])^(3/2)*Sin[c + d*x])/(3*d) + (2*B*(b*Sec[c + d*x])^(5/2)*Sin[c + d*x])/(5*d)

Rule 2719

Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticE[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ[{
c, d}, x]

Rule 2720

Int[1/Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticF[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ
[{c, d}, x]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3856

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Dist[(b*Csc[c + d*x])^n*Sin[c + d*x]^n, Int[1/Sin[c + d
*x]^n, x], x] /; FreeQ[{b, c, d}, x] && EqQ[n^2, 1/4]

Rule 3872

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rubi steps \begin{align*} \text {integral}& = A \int (b \sec (c+d x))^{5/2} \, dx+\frac {B \int (b \sec (c+d x))^{7/2} \, dx}{b} \\ & = \frac {2 A b (b \sec (c+d x))^{3/2} \sin (c+d x)}{3 d}+\frac {2 B (b \sec (c+d x))^{5/2} \sin (c+d x)}{5 d}+\frac {1}{3} \left (A b^2\right ) \int \sqrt {b \sec (c+d x)} \, dx+\frac {1}{5} (3 b B) \int (b \sec (c+d x))^{3/2} \, dx \\ & = \frac {6 b^2 B \sqrt {b \sec (c+d x)} \sin (c+d x)}{5 d}+\frac {2 A b (b \sec (c+d x))^{3/2} \sin (c+d x)}{3 d}+\frac {2 B (b \sec (c+d x))^{5/2} \sin (c+d x)}{5 d}-\frac {1}{5} \left (3 b^3 B\right ) \int \frac {1}{\sqrt {b \sec (c+d x)}} \, dx+\frac {1}{3} \left (A b^2 \sqrt {\cos (c+d x)} \sqrt {b \sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx \\ & = \frac {2 A b^2 \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {b \sec (c+d x)}}{3 d}+\frac {6 b^2 B \sqrt {b \sec (c+d x)} \sin (c+d x)}{5 d}+\frac {2 A b (b \sec (c+d x))^{3/2} \sin (c+d x)}{3 d}+\frac {2 B (b \sec (c+d x))^{5/2} \sin (c+d x)}{5 d}-\frac {\left (3 b^3 B\right ) \int \sqrt {\cos (c+d x)} \, dx}{5 \sqrt {\cos (c+d x)} \sqrt {b \sec (c+d x)}} \\ & = -\frac {6 b^3 B E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d \sqrt {\cos (c+d x)} \sqrt {b \sec (c+d x)}}+\frac {2 A b^2 \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right ) \sqrt {b \sec (c+d x)}}{3 d}+\frac {6 b^2 B \sqrt {b \sec (c+d x)} \sin (c+d x)}{5 d}+\frac {2 A b (b \sec (c+d x))^{3/2} \sin (c+d x)}{3 d}+\frac {2 B (b \sec (c+d x))^{5/2} \sin (c+d x)}{5 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.76 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.58 \[ \int (b \sec (c+d x))^{5/2} (A+B \sec (c+d x)) \, dx=\frac {(b \sec (c+d x))^{5/2} \left (-36 B \cos ^{\frac {5}{2}}(c+d x) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+20 A \cos ^{\frac {5}{2}}(c+d x) \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )+21 B \sin (c+d x)+10 A \sin (2 (c+d x))+9 B \sin (3 (c+d x))\right )}{30 d} \]

[In]

Integrate[(b*Sec[c + d*x])^(5/2)*(A + B*Sec[c + d*x]),x]

[Out]

((b*Sec[c + d*x])^(5/2)*(-36*B*Cos[c + d*x]^(5/2)*EllipticE[(c + d*x)/2, 2] + 20*A*Cos[c + d*x]^(5/2)*Elliptic
F[(c + d*x)/2, 2] + 21*B*Sin[c + d*x] + 10*A*Sin[2*(c + d*x)] + 9*B*Sin[3*(c + d*x)]))/(30*d)

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 30.59 (sec) , antiderivative size = 564, normalized size of antiderivative = 3.30

method result size
parts \(-\frac {2 A \sqrt {b \sec \left (d x +c \right )}\, b^{2} \left (i \operatorname {EllipticF}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \cos \left (d x +c \right )+i \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {EllipticF}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right )-\tan \left (d x +c \right )\right )}{3 d}-\frac {2 B \,b^{2} \sqrt {b \sec \left (d x +c \right )}\, \left (3 i \operatorname {EllipticE}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \cos \left (d x +c \right )^{2}-3 i \operatorname {EllipticF}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \cos \left (d x +c \right )^{2}+6 i \operatorname {EllipticE}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \cos \left (d x +c \right )-6 i \operatorname {EllipticF}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \cos \left (d x +c \right )+3 i \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {EllipticE}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right )-3 i \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {EllipticF}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right )-3 \sin \left (d x +c \right )-\tan \left (d x +c \right )-\sec \left (d x +c \right ) \tan \left (d x +c \right )\right )}{5 d \left (\cos \left (d x +c \right )+1\right )}\) \(564\)
default \(-\frac {2 b^{2} \sqrt {b \sec \left (d x +c \right )}\, \left (5 i A \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {EllipticF}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \cos \left (d x +c \right )^{2}-9 i B \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {EllipticF}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \cos \left (d x +c \right )^{2}+9 i B \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {EllipticE}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \cos \left (d x +c \right )^{2}+10 i A \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {EllipticF}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \cos \left (d x +c \right )-18 i B \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {EllipticF}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \cos \left (d x +c \right )+18 i B \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {EllipticE}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \cos \left (d x +c \right )+5 i A \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \operatorname {EllipticF}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}-9 i B \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \operatorname {EllipticF}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}+9 i B \sqrt {\frac {1}{\cos \left (d x +c \right )+1}}\, \operatorname {EllipticE}\left (i \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ), i\right ) \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}-5 A \sin \left (d x +c \right )-9 B \sin \left (d x +c \right )-5 A \tan \left (d x +c \right )-3 B \tan \left (d x +c \right )-3 B \tan \left (d x +c \right ) \sec \left (d x +c \right )\right )}{15 d \left (\cos \left (d x +c \right )+1\right )}\) \(627\)

[In]

int((b*sec(d*x+c))^(5/2)*(A+B*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

-2/3*A/d*(b*sec(d*x+c))^(1/2)*b^2*(I*(1/(cos(d*x+c)+1))^(1/2)*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*EllipticF(I*(-
cot(d*x+c)+csc(d*x+c)),I)*cos(d*x+c)+I*(1/(cos(d*x+c)+1))^(1/2)*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*EllipticF(I*
(-cot(d*x+c)+csc(d*x+c)),I)-tan(d*x+c))-2/5*B/d*b^2*(b*sec(d*x+c))^(1/2)/(cos(d*x+c)+1)*(3*I*(cos(d*x+c)/(cos(
d*x+c)+1))^(1/2)*(1/(cos(d*x+c)+1))^(1/2)*EllipticE(I*(-cot(d*x+c)+csc(d*x+c)),I)*cos(d*x+c)^2-3*I*(cos(d*x+c)
/(cos(d*x+c)+1))^(1/2)*(1/(cos(d*x+c)+1))^(1/2)*EllipticF(I*(-cot(d*x+c)+csc(d*x+c)),I)*cos(d*x+c)^2+6*I*(cos(
d*x+c)/(cos(d*x+c)+1))^(1/2)*(1/(cos(d*x+c)+1))^(1/2)*EllipticE(I*(-cot(d*x+c)+csc(d*x+c)),I)*cos(d*x+c)-6*I*(
cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*(1/(cos(d*x+c)+1))^(1/2)*EllipticF(I*(-cot(d*x+c)+csc(d*x+c)),I)*cos(d*x+c)+3
*I*EllipticE(I*(-cot(d*x+c)+csc(d*x+c)),I)*(cos(d*x+c)/(cos(d*x+c)+1))^(1/2)*(1/(cos(d*x+c)+1))^(1/2)-3*I*(cos
(d*x+c)/(cos(d*x+c)+1))^(1/2)*EllipticF(I*(-cot(d*x+c)+csc(d*x+c)),I)*(1/(cos(d*x+c)+1))^(1/2)-3*sin(d*x+c)-ta
n(d*x+c)-sec(d*x+c)*tan(d*x+c))

Fricas [C] (verification not implemented)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.12 (sec) , antiderivative size = 213, normalized size of antiderivative = 1.25 \[ \int (b \sec (c+d x))^{5/2} (A+B \sec (c+d x)) \, dx=\frac {-5 i \, \sqrt {2} A b^{\frac {5}{2}} \cos \left (d x + c\right )^{2} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + 5 i \, \sqrt {2} A b^{\frac {5}{2}} \cos \left (d x + c\right )^{2} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) - 9 i \, \sqrt {2} B b^{\frac {5}{2}} \cos \left (d x + c\right )^{2} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) + 9 i \, \sqrt {2} B b^{\frac {5}{2}} \cos \left (d x + c\right )^{2} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right ) + 2 \, {\left (9 \, B b^{2} \cos \left (d x + c\right )^{2} + 5 \, A b^{2} \cos \left (d x + c\right ) + 3 \, B b^{2}\right )} \sqrt {\frac {b}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{15 \, d \cos \left (d x + c\right )^{2}} \]

[In]

integrate((b*sec(d*x+c))^(5/2)*(A+B*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/15*(-5*I*sqrt(2)*A*b^(5/2)*cos(d*x + c)^2*weierstrassPInverse(-4, 0, cos(d*x + c) + I*sin(d*x + c)) + 5*I*sq
rt(2)*A*b^(5/2)*cos(d*x + c)^2*weierstrassPInverse(-4, 0, cos(d*x + c) - I*sin(d*x + c)) - 9*I*sqrt(2)*B*b^(5/
2)*cos(d*x + c)^2*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos(d*x + c) + I*sin(d*x + c))) + 9*I*sqrt
(2)*B*b^(5/2)*cos(d*x + c)^2*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos(d*x + c) - I*sin(d*x + c)))
 + 2*(9*B*b^2*cos(d*x + c)^2 + 5*A*b^2*cos(d*x + c) + 3*B*b^2)*sqrt(b/cos(d*x + c))*sin(d*x + c))/(d*cos(d*x +
 c)^2)

Sympy [F]

\[ \int (b \sec (c+d x))^{5/2} (A+B \sec (c+d x)) \, dx=\int \left (b \sec {\left (c + d x \right )}\right )^{\frac {5}{2}} \left (A + B \sec {\left (c + d x \right )}\right )\, dx \]

[In]

integrate((b*sec(d*x+c))**(5/2)*(A+B*sec(d*x+c)),x)

[Out]

Integral((b*sec(c + d*x))**(5/2)*(A + B*sec(c + d*x)), x)

Maxima [F]

\[ \int (b \sec (c+d x))^{5/2} (A+B \sec (c+d x)) \, dx=\int { {\left (B \sec \left (d x + c\right ) + A\right )} \left (b \sec \left (d x + c\right )\right )^{\frac {5}{2}} \,d x } \]

[In]

integrate((b*sec(d*x+c))^(5/2)*(A+B*sec(d*x+c)),x, algorithm="maxima")

[Out]

integrate((B*sec(d*x + c) + A)*(b*sec(d*x + c))^(5/2), x)

Giac [F]

\[ \int (b \sec (c+d x))^{5/2} (A+B \sec (c+d x)) \, dx=\int { {\left (B \sec \left (d x + c\right ) + A\right )} \left (b \sec \left (d x + c\right )\right )^{\frac {5}{2}} \,d x } \]

[In]

integrate((b*sec(d*x+c))^(5/2)*(A+B*sec(d*x+c)),x, algorithm="giac")

[Out]

integrate((B*sec(d*x + c) + A)*(b*sec(d*x + c))^(5/2), x)

Mupad [F(-1)]

Timed out. \[ \int (b \sec (c+d x))^{5/2} (A+B \sec (c+d x)) \, dx=\int \left (A+\frac {B}{\cos \left (c+d\,x\right )}\right )\,{\left (\frac {b}{\cos \left (c+d\,x\right )}\right )}^{5/2} \,d x \]

[In]

int((A + B/cos(c + d*x))*(b/cos(c + d*x))^(5/2),x)

[Out]

int((A + B/cos(c + d*x))*(b/cos(c + d*x))^(5/2), x)